Arithmetic operators
+
Addition
int sum = 4 + 7;
-
Subtraction
float difference = 18.55 - 14.21;
*
Multiplication
float product = 5 * 3.5;
/
Division
int quotient = 14 / 3;
%
Modulo Reduction (Remainder from integer
division)
int remainder = 10 % 6;
NOTE:
For integer arguments / and % correspond to
the Pascal div and mod operators. Do not use ^ for
computing powers – it denotes “bitwise XOR”.